#include <iostream>
#include <cstring>

using namespace std;

char FirstNotRepeatingChar(char* pString)
{
	int times[256], locations[256];
	for(int i = 0; i < 256; i++)
	{
		times[i] = 0;
		locations[i] = 0;
	}
	for(int i = 0; i < strlen(pString) - 1; i++)
	{
		times[pString[i]]++;
		if(times[pString[i]] == 1)
			locations[pString[i]] = i;
	}
	int min = strlen(pString);
	for(int i = 0; i < 256; i++)
	{
		if(times[i] == 1 && min >  locations[i])
			min = locations[i];
		//cout<<times[i]<<" "<<locations[i];
	}
	return pString[min];
}

int main()
{
	char s[100] = "abaccdeff";
	cout<<FirstNotRepeatingChar(s)<<endl;
}
